package com.itheima.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @Author Andy
 * @Description //TODO MybatisPlusInteceptor
 * @Date 2022/3/9 10:02 上午
 * @Version 1.0
 **/
@Component
public class MybatisPlusConfig {

//    讲师能默写下来，是因为敲了n遍了，死记硬背下来的，你们不需要，只需要知道有这个东西就行了，千万别死记硬背。
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
        MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
        mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor());
        return mybatisPlusInterceptor;
    }

}
